<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <common-head></common-head>
    
  </div>
  <script src="./vue.js"></script>
  <script>
    Vue.component('CommonHead', {
      // template 当前组件的视图结构
      template: `
        <div>
          <h2>这是一个公共的头部 父组件</h2>  
          <common-logo></common-logo>
        </div>
      `,
      components: {
        CommonLogo: {
          template:`
            <div>
              <h3>这是局部组件</h3>  
              {{ msg }}
            </div>
          `,
          data(){
            return {
              msg: '这是子组件的数据'
            }
          }
        }
      }
    })
    const vm = new Vue({
      el: '#app'
    })
  </script>
</body>
</html>